<style lang="less">
    @import "preliminaryApprove.less";
</style>
<template>
    <div class="detail">
        <back-top :height="100" :duration="250" style="padding: 10px" :bottom="500" :right="0">
            <i-button type="primary" shape="circle" size="default" >返回顶端</i-button>
        </back-top>
        <Row>
                <Card style="width:100%" shadow>
                <Row>
                    <Tabs value="name1" type="card" :animated="true" >
                        <TabPane label="征信报告" icon="md-cash" name="name1">
                            <credit-pboc :apply-no="applyNo" :type="'2'" :credit-score="''"/>
                        </TabPane>
                        <TabPane label="影像资料" name="name2" @on-click="initImage">
                            <ImagePreview :access="access" :codes="uniqueCodes" :busiNo="busiNo" :belongNo="belongNo" :isInit="isView" :path="path"></ImagePreview>
                        </TabPane>
                        <TabPane label="规则提示" icon="md-analytics" name="name3">
                            <Collapse style="padding: 15px" v-model="values">
                            <Panel name="1">
                                规则提示
                                <div slot="content">
                                    <Row >
                                        <Form :label-width="100" class="refuseReasonArr" ref="refuseReasonArr">
                                            <FormItem label="拒绝原因"prop="refuseReasonArr">
                                                <Input type="textarea"  v-model="refuseReasonArr"
                                                       :rows="4"
                                                       :disabled="true"
                                                       style="width: 500px"
                                                       class="msgTextarea"
                                                       maxlength="512" />
                                            </FormItem>
                                        </Form>
                                    </Row>
                                </div>
                            </Panel>
                            </Collapse>
                        </TabPane>
                    </Tabs>
                </Row>
            </Card>
        </Row>
    </div>
</template>
<script>


    import CreditPboc from "../../approve-task/creditPboc";
    import ImagePreview from "../../../../../../basic/pages/image/file-audit/view/imagePreview";
    import {
        queryRefuseReason
    } from "../../../../../api/afs-case/approve/approvePre";
    export default {
        name: "preliminary-approve",
        components: {
            ImagePreview,
            CreditPboc

        },
        data() {
            return {
                applyNo:"",
                uniqueCodes:"",
                refuseReasonArr: {},
                isView:false,
                values:["1"],
                busiNo:"",
                belongNo:"",
                access:"code",
                path:"case"
            };
        },
        methods: {
            init(){
                this.initImage();
                this.queryRefuseReason();
            },
            queryRefuseReason() {
                let params = {
                    applyNo: this.applyNo
                }
                queryRefuseReason(params).then(res => {
                    if (res.code = "0000") {
                        if (res.data !== "") {
                            this.refuseReasonArr = res.data;
                        }
                    }
                })
            },
            initImage(){
                this.isView=true
                this.busiNo=this.afs.getPageParams(this).applyNo
                this.belongNo=this.afs.getPageParams(this).applyNo
                this.uniqueCodes="preBorrowerIdcardFront,preBorrowerIdcardBack,creditAuthorizationFile"
            },
        },
        mounted() {
            this.init();
        },
        created() {
            this.applyNo = this.afs.getPageParams(this).applyNo;
        },
    };
</script>
